package study.itheima.myresponse;

import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;

@WebServlet("/ResponsePractice1")
public class ResponsePractice1 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //使用响应对象向浏览器响应中文数据.
        resp.setContentType("Text/Html;charset=UTF-8");
        PrintWriter pw = resp.getWriter();
        pw.write("污渍不行");
        pw.write("<br/>");
        pw.write("污渍不行");
        pw.close();
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
